from todo_api_project.api.creat_task_api import creattask_model
from todo_api_project.base.mybase import Tools


class deletetask_model(Tools):

    # 定义路径
    path = '/task/info'

    # 发送注册请求
    def deletetask_action(self,task_id,hb):
        mydata = {
            "task_id": task_id,

        }
        res = self.huihua.delete(url=self.hosturl+self.path,data=mydata,headers=hb)
        return res.json()

from todo_api_project.api.login_api import login_model

import requests
s = requests.session()
reg = login_model(huihua=s)
msg = reg.login_action(usr='ueuquu1342',pwd='afhahfhai34')
getuserid = msg['userId']
getusertoke = msg['userToken']
hb = {'userid':getuserid,'userToken':getusertoke}
print(hb)
creaktask = creattask_model(huihua=s)
msg = creaktask.creattask_action(title='xiuga',hb=hb)
gettaskid = msg['taskid']
deletetask = deletetask_model(huihua=s)
ss = deletetask.deletetask_action(task_id=gettaskid,hb=hb)
print(ss)
